package com.wondersgroup.esclient.feign;

import java.util.Map;

import feign.Body;
import feign.HeaderMap;
import feign.Headers;
import feign.Param;
import feign.RequestLine;

//给所有方法设置Accept请求头
@Headers("Accept: application/json")
public interface FeignInterface {
	// 单独给get方法设置Content-Type请求头
	@Headers("Content-Type: application/json")
	@RequestLine("GET")
	String httpGet(@HeaderMap Map<String, Object> headerMap);

	// 单独给get方法设置Content-Type请求头
	@Headers("Content-Type: application/json")
	@RequestLine("GET")
	String httpGet();

	@Body("{body}")
	@RequestLine("POST")
	@Headers("Content-Type: application/json;charset=UTF-8")
	String httpPost(@Param("body") String body);
	
	@Body("{body}")
	@RequestLine("POST")
	String httpPost(@HeaderMap Map<String, Object> headerMap, @Param("body") String body);
	
	@Body("{body}")
	@RequestLine("PUT")
	@Headers("Content-Type: application/json;charset=UTF-8")
	String httpPut(@Param("body") String body);
	
	@Body("{body}")
	@RequestLine("PUT")
	String httpPut(@HeaderMap Map<String, Object> headerMap, @Param("body") String body);
}
